import React,{Component,Fragment} from 'react';
import {renderRoutes} from 'react-router-config';
import Header from '../components/Header';
import actions from '../store/actions/session';
import styles from './App.css';
import withStyles from '../withStyles';
class App extends Component{
	componentWillMount() {
		if (this.props.staticContext) {
			 this.props.staticContext.csses.push(styles._getCss());
		}
  }
	render() {
		return (
			<Fragment>
				<Header/>
				<div className="container" className={styles.app}>
					<Fragment>
					  {renderRoutes(this.props.route.routes)}
					</Fragment>
				</div>
			</Fragment>
		)
    }
}
App=withStyles(App,styles);
App.loadData=(store) => {
	return store.dispatch(actions.getUser());
}
export default App; 